﻿using FDStudio.Core.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace FDStudio.Core.Config
{
    /*
     CreatedOn: 2018-03-08
     CreatedBy: Jackie Lee(天宇遊龍)
     */
    /// <summary>
    /// 上下文选项
    /// </summary>
    public class ContextOptions
    {
        /// <summary>
        /// 所支持的读写操作类型
        /// </summary>
        public DatabaseOperType DatabaseOperType { get; set; }

        /// <summary>
        /// 只读连接配置名称
        /// </summary>
        public string ReadOnlyConnName { get; set; }

        /// <summary>
        /// 只写连接配置名称
        /// </summary>
        public string WriteOnlyConnName { get; set; }
    }

    /// <summary>
    /// 上下文选项
    /// </summary>
    public class ReadOnlyContextOptions : IReadOnlyContextOptions
    {
        /// <summary>
        /// 只读连接配置名称
        /// </summary>
        public string ConnConfigName { get; set; }
    }

    /// <summary>
    /// 只读上下文选项
    /// </summary>
    public class WriteOnlyContextOptions : IWriteOnlyContextOptions
    {
        /// <summary>
        /// 只写连接配置名称
        /// </summary>
        public string ConnConfigName { get; set; }
    }

    //public interface IContextOptions : IReadOnlyContextOptions, IWriteOnlyContextOptions
    //{
    //    /// <summary>
    //    /// 所支持的读写操作类型
    //    /// </summary>
    //    DatabaseOperType DatabaseOperType { get; set; }

    //}

    public interface IWriteOnlyContextOptions : IContextOptions
    {
    }

    public interface IReadOnlyContextOptions : IContextOptions
    {
    }

    public interface IContextOptions
    {
        /// <summary>
        /// 连接配置名称
        /// </summary>
        string ConnConfigName { get; set; }
    }
}
